var ResourceManager = function () {
    this.on = new EventSet();
    this.on.add('manifestLoaded');
    this.manifest = {};
    this.resourceLoaders = {};
    this.manifestLoaderTask = new AsyncTask();
    this.resourceLoader = new ResourceLoader();
    this.init();
};

ResourceManager.prototype.init = function () {
    var req = this.manifestLoaderTask.GET(this, '../manifest.json');
    this.manifestLoaderTask.send(this);
    req.complete((function (response) {
        this.manifest = JSON.parse(response);
        this.on.fire('manifestLoaded');
    }).bind(this));
};

ResourceManager.prototype.require = function (type, id, callback) {
    return this.resourceLoader.load(type, id, callback);
};